# 基于django-filter插件，完成指定区间筛选（一般都是对应数字字段）
from django_filters.rest_framework.filterset import FilterSet
from django_filters import filters
from . import models
class OrderFilterSet(FilterSet):
    max_price = filters.NumberFilter(field_name='price', lookup_expr='lte')
    min_price = filters.NumberFilter(field_name='price', lookup_expr='gte')

    class Meta:
        model = models.Order
        fields = ['user', 'store']

class OrderDetailFilterSet(FilterSet):
    class Meta:
        model = models.OrderDetail
        fields = ['user']